<?php $this->load->view('headerfooter/header'); ?>
<script type="text/javascript">
	function printDiv(divName) {
		var printContents = document.getElementById(divName).innerHTML;
		var originalContents = document.body.innerHTML;
		document.body.innerHTML = printContents;
		window.print();
		document.body.innerHTML = originalContents;
	}
</script>
      <!-- Begin page content -->
<div class="container">
	<div class="col-sm-10 col-sm-offset-1">
		<!-- div style="margin-left:190px" -->
		<div>
			<!-- h4 style="text-align:center;background:white;width:500px;padding:20px"><a href="<?=base_url()?>index.php/pencarian">Pencarian Kembali</a></h4 -->
		</div>
        <div class="panel panel-success">
			<div class="panel-heading">
				<div class="panel-title"><?=$title?></div>
			</div>
			<div class="panel-isi" id="printableArea">
			<?php if (!isset($message)) : ?>
				<table class="table table-striped">
					<thead>
						<tr>
							<th>No</th>
							<th>Kode Surat</th>
							<th>Nama Instansi</th>
							<th>Tanggal Kerjasama</th>
							<th>Masa Berlaku</th>
							<th>Kerjasama</th>
							<th>Nomer Surat</th>
							<th>Unit Terkait</th>
							<th class="noPrint" colspan="2">Action</th>
						</tr>
					</thead>
					<tbody class="table-hover">
					<?php
					$i = 0;
					foreach ($hasil->result() as $row) :
						?>
						<tr>
							<td><?= ++$i ?></td>
							<td><?= $row->kode_surat ?></td>
							<td><?= $row->nama_instansi ?></td>
							<td><?= $row->tanggal_kerjasama?></td>
							<td><?= $row->masa_berlaku ?></td>
							<td><?= $row->kerjasama_mengenai ?></td>
							<td><?= $row->nomersurat ?></td>
							<td><?= $row->unit_terkait ?></td></div>
							<td><a class="noPrint btn btn-primary" href="<?=site_url()?>/surat/view/<?=$row->idsurat?>">
								<i class="fa fa-eye"></i> View
							</a></td>
                            <td><a class="noPrint btn btn-primary" href="<?=site_url()?>/surat/edit/<?=$row->idsurat?>">
								<i class="fa fa-pencil"></i> Edit
							</a></td>
						</tr>
					<?php endforeach; ?>
					</tbody>
				</table>
				<button class="btn btn-danger btn-block btn-lg noPrint" type="button" onclick="printDiv('printableArea')"  /><i class="fa fa-print"></i> Cetak Hasil Pencarian</button>
				</div>
			<?php else : ?>
				<h2><?=$message?></h2>
			<?php endif; ?>
			</div>
		</div>
	</div>
</div>
<?php $this->load->view('headerfooter/footer'); ?>